package work.jame.blog.framework.constant;

import work.jame.blog.framework.limit.impl.TooManyRequestLimitHandler;

/**
 * redis key 前缀常量类
 *
 * @author Jame!
 * @date 2023/5/9 下午 10:36
 */
public class RedisKeyPrefixConstant {

    /**
     * 登录用户存放token key前缀
     */
    public static final String LOGIN_USER_TOKEN_PREFIX = "token:";

    /**
     * 登录失败用户ip前缀
     */
    public static final String LOGIN_FAIL_IP_PREFIX = "login_fail_ip:";

    /**
     * 登录失败用户email前缀
     */
    public static final String LOGIN_FAIL_EMAIL_PREFIX = "login_fail_email:";

    /**
     * 用户登录验证码前缀
     */
    public static final String LOGIN_CODE_PREFIX = "login_code:";

    /**
     * 用户登录邮箱验证码
     */
    public static final String LOGIN_EMAIL_CODE_PREFIX = "login_email_code:";

    /**
     * 用户注册验证码前缀
     */
    public static final String REGISTER_CODE_PREFIX = "register_code:";

    /**
     * 用户注册验证码前缀
     */
    public static final String REGISTER_EMAIL_CODE_PREFIX = "register_email_code:";


    /**
     * 用户找回密码验证码
     */
    public static final String FIND_PASSWORD_CODE_PREFIX = "find_password_code:";

    /**
     * 用户找回密码邮箱验证码
     */
    public static final String FIND_PASSWORD_EMAIL_CODE_PREFIX = "find_password_email_code:";


    /**
     * 用户模式限流前缀
     */
    public static final String REQUEST_LIMIT_USER_PREFIX = "request_limit_user:";

    /**
     * ip模式限流前缀
     */
    public static final String REQUEST_LIMIT_IP_PREFIX = "request_limit_ip:";

    /**
     * 太多请求处理器ip限流前缀
     *
     * @see TooManyRequestLimitHandler
     */
    public static final String TOO_MANY_REQUEST_HANDLER_LIMIT_IP_PREFIX = "too_many_request_handler_limit_ip:";


    /**
     * 禁止请求ip前缀
     */
    public static final String DISABLE_REQUEST_IP_PREFIX = "disable_request_ip:";

    /**
     * 白名单ip前缀
     */
    public static final String WHITE_LIST_IP_PREFIX = "white_list_ip:";


    /**
     * 白名单用户id前缀
     */
    public static final String WHITE_LIST_USER_ID_PREFIX = "white_list_user_id:";


    /**
     * 黑名单ip前缀
     */
    public static final String BLACK_LIST_IP_PREFIX = "black_list_ip:";

}
